package com.moli.iov.base.model;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.moli.iov.base.model.po.TerminalInstallationAudit;

import java.util.Date;

/**
 * The type Terminal installation audit param.
 *
 * @author wanghualin
 * @date 2020 -02-24 13:13:23
 */
public class TerminalInstallationAuditParam {
    private QueryWrapper<TerminalInstallationAudit> queryWrapper;

    public TerminalInstallationAuditParam() {
        queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("is_delete", 0);
    }

    public QueryWrapper<TerminalInstallationAudit> get() {
        return queryWrapper;
    }

    public TerminalInstallationAuditParam queryEqAuditStatus(Integer auditStatus) {
        TerminalInstallationAudit audit=new TerminalInstallationAudit();
        if (auditStatus!=null) {
            queryWrapper.eq(TerminalInstallationAudit.AUDIT_STATUS, auditStatus);
        }
        return this;
    }

    public TerminalInstallationAuditParam queryEqVin(String vin) {
        if (vin != null && !vin.isEmpty()) {
            queryWrapper.eq(TerminalInstallationAudit.VIN, vin);
        }
        return this;
    }
    public TerminalInstallationAuditParam queryEqDeviceId(String deviceId) {
        if (deviceId != null && !deviceId.isEmpty()) {
            queryWrapper.eq(TerminalInstallationAudit.DEVICE_ID, deviceId);
        }
        return this;
    }
    public TerminalInstallationAuditParam queryEqCompanyId(Long companyId) {
        if (companyId != null) {
            queryWrapper.eq(TerminalInstallationAudit.COMPANY_ID, companyId);
        }
        return this;
    }
    public TerminalInstallationAuditParam queryBetweenRegisterTime(Date startTime, Date endTime){
        if(startTime!=null && endTime!=null){
            queryWrapper.between(TerminalInstallationAudit.REGISTER_TIME,startTime,endTime);
        }
        return this;
    }
}
